import React,{useState, useDeferredValue, useMemo} from 'react';
import List from './18-List';
const App = () => {

  const [inpValue, setInpValue] = useState('')

  const deferredValue = useDeferredValue(inpValue)

  const memoList = useMemo(()=>{
    return <List text={deferredValue} />
  }, [deferredValue])

  return (
    <div>

      <input type="text" value={inpValue} onChange={e=> setInpValue(e.target.value)} />
      {/* 输入框输入内容之后我要将输入的内容显示 5000 份 */}
      {memoList}
      {/* <List text={inpValue} /> */}
    </div>
  );
};

export default App;
